package org.raymond.iworks.repository.entity.enums;

import lombok.Getter;

import java.util.Objects;

public enum YNEnum {
    Y("Y"),
    N("N");

    @Getter
    private final String code;

    YNEnum(String code){
        this.code = code;
    }

    public static YNEnum getByCode(String code) {
        for (YNEnum e: YNEnum.values()) {
            if (Objects.equals(code, e.getCode())) {
                return e;
            }
        }
        return null;
    }
}
